<template>
  <div class="box">
    <div class="top">{{ this.tip }}</div>

    <div class="back">
      <router-view></router-view>
      <van-tabbar v-model="active" @change="onChange">
        <van-tabbar-item replace to="/index" icon="home-o"
          >主页</van-tabbar-item
        >
        <van-tabbar-item replace to="/index/message" icon="chat-o"
          >消息</van-tabbar-item
        >
        <van-tabbar-item replace to="/index/attendance" icon="shop-o"
          >打卡</van-tabbar-item
        >
        <van-tabbar-item replace to="/index/ownpage" icon="user-circle-o"
          >我</van-tabbar-item
        >
      </van-tabbar>
    </div>
  </div>
</template>


<script>
// import { Notify } from 'vant';
export default {
  name: "index",

  data() {
    return {
      active: "",
      list: ["主页", "消息", "打卡", "我"],
      tip: "我",
    };
  },
  mounted() {
    console.log(this.$route)
  },
  methods: {
    onChange(index) {
      //   Notify({ type: 'primary', message: index });
      this.tip = this.list[index];
      console.log(this.tip);
    },
  },
};
</script>

<style scoped>
.top {
  height: 46px;
  position: fixed;
  z-index: 99;
  top: 0;
  width: 100vw;
  border-bottom: 1px solid #eee;
  background-color: white;
  line-height: 47px;
  text-align: center;
}
.back {
  background-color: #eeeeee;
  margin-top: 47px;
  height: 100vh;
}
</style>
